home *** CD-ROM | disk | FTP | other *** search
/ Network CD 2 / Network CD - Volume 2.iso / programs / internet / tcp / amitcp / amitcp-api-22.lha / AmiTCP-2.2 / netinclude / sys / param.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-08-12  |  2.3 KB  |  114 lines

  1. #ifndef SYS_PARAM_H
  2. #define SYS_PARAM_H
  3. /*
  4.  * $Id: param.h,v 1.11 1993/06/04 11:16:15 jraja Exp $
  5.  *
  6.  * Copyright (c) 1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
  7.  *                    Helsinki University of Technology, Finland.
  8.  *                    All rights reserved.
  9.  *
  10.  */
  11.  
  12. #define    BSD    199103    /* March, 1991 system version (year & month) */
  13. #define BSD4_3    1
  14. #define BSD4_4    1
  15.  
  16. #ifndef SYS_TYPES_H
  17. #include <sys/types.h>
  18. #endif
  19.  
  20. #define NOFILE        FD_SETSIZE /* perhaps we shouldn't use FD_SETSIZE */
  21.  
  22. #define    BIG_ENDIAN    4321    /* MSB first: 68000, ibm, net */
  23. #define    BYTE_ORDER    BIG_ENDIAN
  24.  
  25. #define MAXHOSTNAMELEN  64       /* max length of hostname */
  26.  
  27. /*
  28.  * Macros for network/external number representation conversion.
  29.  */
  30. #ifndef ntohl
  31. #define    ntohl(x)    (x)
  32. #define    ntohs(x)    (x)
  33. #define    htonl(x)    (x)
  34. #define    htons(x)    (x)
  35.  
  36. #define    NTOHL(x)    (x)
  37. #define    NTOHS(x)    (x)
  38. #define    HTONL(x)    (x)
  39. #define    HTONS(x)    (x)
  40. #endif
  41.  
  42. /* Limits */
  43. #if __SASC
  44. #ifndef _LIMITS_H
  45. #include <limits.h>
  46. #endif
  47. #elif __GNUC__
  48. #ifndef _MACHINE_LIMITS_H
  49. #include <machine/limits.h>
  50. #endif
  51. #undef LONGBITS            /* exec/types wants to use this symbol */
  52. #undef BITSPERBYTE        /* dos/dos.h defines this */
  53. #undef MAXINT            /* dos/dos.h defines this */
  54. #undef MININT            /* dos/dos.h defines this */
  55. #endif
  56.  
  57. /* Bit map related macros. */
  58. #define    setbit(a,i)    ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
  59. #define    clrbit(a,i)    ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
  60. #define    isset(a,i)    ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
  61. #define    isclr(a,i)    (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
  62.  
  63. /* Macros for counting and rounding. */
  64. #ifndef howmany
  65. #define    howmany(x, y)    (((x)+((y)-1))/(y))
  66. #endif
  67. #define    roundup(x, y)    ((((x)+((y)-1))/(y))*(y))
  68. #define powerof2(x)    ((((x)-1)&(x))==0)
  69.  
  70. #ifndef KERNEL            /* Kernel has these in kern/amiga_subr.h */
  71. #if __SASC            /* SASC has built-in versions */
  72. #ifndef _STRING_H
  73. #ifndef USE_BUILTIN_MATH
  74. #define USE_BUILTIN_MATH
  75. #endif
  76. #include <string.h>
  77. #endif
  78.  
  79. #else
  80.  
  81. #ifndef min
  82. #define min(x,y) ((x) < (y) ? (x) : (y))
  83. #endif
  84. #ifndef max
  85. #define max(x,y) ((x) > (y) ? (x) : (y))
  86. #endif
  87.  
  88. #endif
  89. #endif /* !KERNEL */
  90.  
  91. /* More types and definitions used throughout the kernel. */
  92. #ifdef KERNEL
  93.  
  94. #ifndef SYS_CDEFS_H
  95. #include <sys/cdefs.h>
  96. #endif
  97.  
  98. #ifndef SYS_ERRNO_H
  99. #include <sys/errno.h>
  100. #endif
  101.  
  102. #ifndef SYS_TIME_H
  103. #include <sys/time.h>
  104. #endif
  105.  
  106. #ifndef SYS_UIO_H
  107. #include <sys/uio.h>
  108. #endif
  109.  
  110. #endif /* KERNEL */
  111. #endif /* !SYS_PARAM_H */
  112.  
  113.  
  114.